package com.lk.sys.common.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author Lukang
 * @date 2021/10/25
 * @apiNote
 */
@Data
public class PageObject<T> implements Serializable {

    private static final long serialVersionUID = -2132044376052037392L;
    /**封装查询到的当前页记录*/
    private List<T> records;
    /**查询到的总记录数*/
    private Long rowCount;
    /**总页码数*/
    private Long pageCount;
    /**页面大小*/
    private Integer pageSize;
    /**当前页码值*/
    private Long pageCurrent;

    public PageObject(List<T> records, Long rowCount, Integer pageSize, Long pageCurrent) {
        this.records = records;
        this.rowCount = rowCount;
        this.pageSize = pageSize;
        this.pageCurrent = pageCurrent;
        this.pageCount = (rowCount-1)/pageSize+1;
    }
}
